package thread;

public class Thread2{
	public static void main(String[] arg){
		A[] as=new A[100];
		as[1].getI();
		/*int[] is=new int[1*3];
		System.out.println(is);
		Integer  a = 100;
		Integer b = 100;
		boolean c = a == b ? true : false;
		System.out.println(c);*/
		/*B b=new B();
		b.start();
		System.out.println(b.tt());*/
	}
}
class B extends Thread{
	private A a =new A();
	@Override
	public void run() {
		synchronized (this) {
			a.setI(2);
			try {
				Thread.sleep(1000);
				System.out.println(a.getI());
			} catch (InterruptedException e) {
				
				e.printStackTrace();
			}
		}
		super.run();
	}
	public synchronized Integer tt(){
		return a.getI();
	}

}
class A{
	private Integer i=1;
	public Integer getI() {
		return i;
	}
	public void setI(Integer i) {
		this.i = i;
	}	
}
